package org.platform.executor.knowledge;

import com.mc.mic.core.bus.provider.IMicProviderServiceExecutor;
import lombok.extern.slf4j.Slf4j;
import org.platform.mo.csmo.cmd10022.KnowApplyRequestParam;
import org.platform.mo.csmo.cmd10022.KnowApplyResponseParam;
import org.platform.service.knowledge.KnowledgeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;

/**
 * @author FengJie
 * @date 2018/4/16
 */
@Service
@Slf4j
public class KnowApplyExecutor implements IMicProviderServiceExecutor<KnowApplyRequestParam, KnowApplyResponseParam> {
    @Autowired
    private KnowledgeServiceImpl service;

    @Override
    public KnowApplyResponseParam doExecute(KnowApplyRequestParam requestParam) {
        try {
            return service.knowApply(requestParam);
        } catch (IOException e) {
            log.error("知识申请错误错误,异常信息:", e);
            throw new RuntimeException(e);
        }
    }

}
